project('a04_mines', 'c', 
        version: '1.0.0',
        default_options: [ 'buildtype=debugoptimized', 'warning_level=1' ],
        meson_version : '>= 0.48.0',
        license: 'LGPLv2.1+')

glib_major_req = 2 
glib_minor_req = 57 
glib_micro_req = 2 

gnome = import('gnome')

gtk_debug_cflags = [] 
debug = get_option('debug') 
optimization = get_option('optimization') 
if debug 
    gtk_debug_cflags += '-DG_ENABLE_DEBUG'
    if optimization in ['0', 'g'] 
        gtk_debug_cflags += '-DG_ENABLE_CONSISTENCY_CHECKS' 
    endif 
elif optimization in ['2', '3', 's'] 
    gtk_debug_cflags += '-DG_DISABLE_CAST_CHECKS' 
endif

add_project_arguments(gtk_debug_cflags, language: 'c') 

glibDep = dependency ('glib-2.0')
gtkDep = dependency('gtk+-3.0')


resources = gnome.compile_resources(
    'resources',
    'mines.gresource.xml',
    source_dir:'.',
    c_name: 'resources'
)

schemas = gnome.compile_schemas()

mines = executable(
    'a04_mines.exe',
    'mines.c',
    'mine_view.c',
    resources,
    schemas,
    dependencies: [gtkDep, glibDep]
)

